#增加导入请求处理对象
from flask import Flask, render_template,request
app=Flask(__name__)
@app.route("/")
def hello() -> str:
    return 'hello world from Flash!'
#接收post请求和get请求
@app.route("/search4",methods=['post','get'])
def do_search() -> str:
    #从请求的表单中取字段
    phrase = request.form['phrase']
    letters=request.form['letters']
    return str(search4letters(phrase, letters))
@app.route("/entry")
def entry_page() -> 'html':
    return render_template('entry.html',the_title='WWH标题1')

def search4letters(strA:str, strB:str)->set:
    """查找字符串B中包含字符串A中的字母的集合"""
    return set(strA).intersection(set(strB))
app.run(debug=True)
